import store from '@/store'
export function filterPlan(code) {
    if(code == '') return '';
    let planList = store.getters && store.getters.planList;
    let index = planList.findIndex(ele => ele.id == code);
    return index > -1 ? planList[index].name : code;
}
export function filtercComponent(code) {
    if(code == '') return '';
    let planList = store.getters && store.getters.componentList;
    let index = planList.findIndex(ele => ele.id == code);
    return index > -1 ? planList[index].entName : code;
}
export function filterMaster(code) {
    if(code == '') return '';
    let planList = store.getters && store.getters.masterList;
    let index = planList.findIndex(ele => ele.userId == code);
    return index > -1 ? planList[index].name : code;
}
export function filterContract(code) {
    if(code == '') return '';
    let planList = store.getters && store.getters.contractList;
    let index = planList.findIndex(ele => ele.id == code);
    return index > -1 ? planList[index].name : code;
}
export function filterMaintainCompany(code) {
    if(code == '') return '';
    let planList = store.getters && store.getters.maintainCompanyList;
    let index = planList.findIndex(ele => ele.id == code);
    return index > -1 ? planList[index].companyName : code;
}

export function filterQuestionTitle(code) {
    if(code == '') return '';
    let planList = store.getters && store.getters.questionTitleList;
    let index = planList.findIndex(ele => ele.id == code);
    return index > -1 ? planList[index].title : code;
}

export function filterCompanyMaster(code) {
    if(code == '') return '';
    let planList = store.getters && store.getters.companyMasterList;
    let index = planList.findIndex(ele => ele.userId == code);
    return index > -1 ? planList[index].nickName : code;
}